function [target]=FindTarget(settings,weather,target,time,alt)
%*=+--+=#=+--      UAS Severe Weather Simulation Softeware        --+=#=+--+=#*%
%          Copyright (C) 2013 Regents of the University of Colorado.           %
%                             All Rights Reserved.                             %
%                                                                              %
%    This program is free software: you can redistribute it and/or modify      %
%    it under the terms of the GNU General Public License version 2 as         %
%    published by the Free Software Foundation.                                %
%                                                                              %
%    This program is distributed in the hope that it will be useful,           %
%    but WITHOUT ANY WARRANTY; without even the implied warranty of            %
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             %
%    GNU General Public License for more details.                              %
%                                                                              %
%    You should have received a copy of the GNU General Public License         %
%    along with this program.  If not, see <http://www.gnu.org/licenses/>.     %
%                                                                              %
%           Jack Elston                                                        %
%           elstonj@colorado.edu                                               %
%                                                                              %
%*=+--+=#=+--                 --+=#=+--+=#=+--                    --+=#=+--+=#*%

  frame = weather.frame;
  target.x = target.x + 80;
  target.y = target.y - 450;
  %target.x = target.x + (settings.sim.ts)*frame.u;
  %target.y = target.y + (settings.sim.ts)*frame.v;
  return;

  weight = 0.2;

  offset.x = -800;
  offset.y = 4500;

  t=floor((time-weather.t0)/weather.ts) +1;
  k=floor((alt-weather.z0)/weather.zs) +1;

  %-----[ look for vortex ]-----%

  cav = curl(weather(t).u(:,:,k),data(t).v(:,:,k));
  %hold off;pcolor(data(t).x(:,:,1),data(t).y(:,:,1),cav); shading interp; hold on;
  [Y,cols]=max(cav);
  [Y,row]=max(max(cav));
  col = cols(row);

  col = floor((target.x-offset.x)/settings.grid.xstep + weight*(col-(target.x-offset.x)/settings.grid.xstep));
  row = floor((target.y-offset.y)/settings.grid.ystep + weight*(row-(target.y-offset.y)/settings.grid.ystep));

  %-----[ look for rain ]-----%

  rain_radius = 30;  %m
  if col - rain_radius > 0
    bound(1,1) = col - rain_radius;
  else
    bound(1,1) = 1;
  end
  bound(2,1) = col;

  if row - rain_radius > 0;
    bound(1,2) = row-rain_radius;
  else
    bound(1,2) = 1;
  end
  if row + rain_radius <= settings.grid.y;
    bound(2,2) = row+rain_radius;
  else
    bound(2,2) = settings.grid.y;
  end

  %plot((col-1)*settings.grid.xstep,(row-1)*settings.grid.ystep,'*y');
  %plot(([bound(1,1) bound(1,1) bound(2,1) bound(2,1) bound(1,1)]-1).*settings.grid.xstep,([bound(1,2) bound(2,2) bound(2,2) bound(1,2) bound(1,2)]-1).*settings.grid.ystep, 'y')

  [Y,cols] = max(data(t).rain(bound(1,1):bound(2,1),bound(1,2):bound(2,2),k)); % 100m each side
  [Y,newrow] = max(max(data(t).rain(bound(1,1):bound(2,1),bound(1,2):bound(2,2),k))); % 100m each side
  newcol = cols(newrow);

  target.x = (newcol+bound(1,1)-1)*settings.grid.xstep+offset.x;
  target.y = (newrow+bound(1,2)-1)*settings.grid.ystep+offset.y;
  %target.radius = 50; %m
